package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Entity;
import java.util.Date;

/**
 * Created by sss on 2017/7/12.
 */
@Entity
@javax.persistence.Table(name = "invoice_detail")
@DynamicInsert
public class InvoiceDetail extends BaseEntity{
    public enum  InvoiceDetail_{
        invoiceNo,terminalNo,orderNo,invoiceTitle,taxpayerId
    }

    private String invoiceNo;

    private String terminalNo;

    private String orderNo;

    private String orderType;

    private String orderName;

    private String pbChannel;

    private String memberNo;

    private Integer invoiceType;

    private Integer invoiceTitleType;

    private String invoiceTitle;

    private Integer status;

    private String taxpayerId;

    private Integer postType;

    private Integer earlyPrepare;

    private String regAddress;

    private String receiverName;

    private String receiverMobile;

    private String receiverAddress;

    private Integer provider;

    private Integer payer;

    private Date wantTime;

    private String companyTel;

    private String bankName;

    private String bankAccount;

    private String comment;

    private String displayText;

    private String extensions;

    private String expressNo;

    @Basic
    @javax.persistence.Column(name = "invoice_no", nullable = true, length = 32)
    public String getInvoiceNo() {
        return invoiceNo;
    }

    public void setInvoiceNo(String invoiceNo) {
        this.invoiceNo = invoiceNo;
    }

    @Basic
    @javax.persistence.Column(name = "terminal_no", nullable = true, length = 32)
    public String getTerminalNo() {
        return terminalNo;
    }

    public void setTerminalNo(String terminalNo) {
        this.terminalNo = terminalNo;
    }

    @Basic
    @javax.persistence.Column(name = "order_no", nullable = true, length = 32)
    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    @Basic
    @javax.persistence.Column(name = "invoice_type", nullable = true)
    public Integer getInvoiceType() {
        return invoiceType;
    }

    public void setInvoiceType(Integer invoiceType) {
        this.invoiceType = invoiceType;
    }

    @Basic
    @javax.persistence.Column(name = "invoice_title", nullable = true, length = 50)
    public String getInvoiceTitle() {
        return invoiceTitle;
    }

    public void setInvoiceTitle(String invoiceTitle) {
        this.invoiceTitle = invoiceTitle;
    }

    @Basic
    @javax.persistence.Column(name = "order_type", nullable = false, length = 16)
    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    @Basic
    @javax.persistence.Column(name = "order_name", nullable = false, length = 16)
    public String getOrderName() {
        return orderName;
    }

    public void setOrderName(String orderName) {
        this.orderName = orderName;
    }

    @Basic
    @javax.persistence.Column(name = "pb_channel", nullable = false, length = 16)
    public String getPbChannel() {
        return pbChannel;
    }

    public void setPbChannel(String pbChannel) {
        this.pbChannel = pbChannel;
    }

    @Basic
    @javax.persistence.Column(name = "member_no", nullable = false, length = 16)
    public String getMemberNo() {
        return memberNo;
    }

    public void setMemberNo(String memberNo) {
        this.memberNo = memberNo;
    }

    @Basic
    @javax.persistence.Column(name = "invoice_title_type", nullable = true)
    public Integer getInvoiceTitleType() {
        return invoiceTitleType;
    }

    public void setInvoiceTitleType(Integer invoiceTitleType) {
        this.invoiceTitleType = invoiceTitleType;
    }

    @Basic
    @javax.persistence.Column(name = "express_no", nullable = true, length = 32)
    public String getExpressNo() {
        return expressNo;
    }

    public void setExpressNo(String expressNo) {
        this.expressNo = expressNo;
    }

    @Basic
    @javax.persistence.Column(name = "status", nullable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @javax.persistence.Column(name = "taxpayer_id", nullable = true, length = 50)
    public String getTaxpayerId() {
        return taxpayerId;
    }

    public void setTaxpayerId(String taxpayerId) {
        this.taxpayerId = taxpayerId;
    }

    @Basic
    @javax.persistence.Column(name = "post_type", nullable = true)
    public Integer getPostType() {
        return postType;
    }

    public void setPostType(Integer postType) {
        this.postType = postType;
    }

    @Basic
    @javax.persistence.Column(name = "early_prepare", nullable = true)
    public Integer getEarlyPrepare() {
        return earlyPrepare;
    }

    public void setEarlyPrepare(Integer earlyPrepare) {
        this.earlyPrepare = earlyPrepare;
    }

    @Basic
    @javax.persistence.Column(name = "reg_address", nullable = true, length = 100)
    public String getRegAddress() {
        return regAddress;
    }

    public void setRegAddress(String regAddress) {
        this.regAddress = regAddress;
    }

    @Basic
    @javax.persistence.Column(name = "receiver_name", nullable = true, length = 10)
    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    @Basic
    @javax.persistence.Column(name = "receiver_mobile", nullable = true, length = 50)
    public String getReceiverMobile() {
        return receiverMobile;
    }

    public void setReceiverMobile(String receiverMobile) {
        this.receiverMobile = receiverMobile;
    }

    @Basic
    @javax.persistence.Column(name = "receiver_address", nullable = true, length = 100)
    public String getReceiverAddress() {
        return receiverAddress;
    }

    public void setReceiverAddress(String receiverAddress) {
        this.receiverAddress = receiverAddress;
    }

    @Basic
    @javax.persistence.Column(name = "provider", nullable = true)
    public Integer getProvider() {
        return provider;
    }

    public void setProvider(Integer provider) {
        this.provider = provider;
    }

    @Basic
    @javax.persistence.Column(name = "payer", nullable = true)
    public Integer getPayer() {
        return payer;
    }

    public void setPayer(Integer payer) {
        this.payer = payer;
    }

    @Basic
    @javax.persistence.Column(name = "want_time", nullable = true)
    public Date getWantTime() {
        return wantTime;
    }

    public void setWantTime(Date wantTime) {
        this.wantTime = wantTime;
    }

    @Basic
    @javax.persistence.Column(name = "company_tel", nullable = true, length = 50)
    public String getCompanyTel() {
        return companyTel;
    }

    public void setCompanyTel(String companyTel) {
        this.companyTel = companyTel;
    }

    @Basic
    @javax.persistence.Column(name = "bank_name", nullable = true, length = 50)
    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    @Basic
    @javax.persistence.Column(name = "bank_account", nullable = true, length = 50)
    public String getBankAccount() {
        return bankAccount;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }

    @Basic
    @javax.persistence.Column(name = "comment", nullable = true, length = 512)
    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @Basic
    @javax.persistence.Column(name = "display_text", nullable = true, length = -1)
    public String getDisplayText() {
        return displayText;
    }

    public void setDisplayText(String displayText) {
        this.displayText = displayText;
    }


    @Basic
    @javax.persistence.Column(name = "extensions", nullable = true, length = 512)
    public String getExtensions() {
        return extensions;
    }

    public void setExtensions(String extensions) {
        this.extensions = extensions;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        InvoiceDetail that = (InvoiceDetail) o;

        if (invoiceNo != null ? !invoiceNo.equals(that.invoiceNo) : that.invoiceNo != null) return false;
        if (terminalNo != null ? !terminalNo.equals(that.terminalNo) : that.terminalNo != null) return false;
        if (orderNo != null ? !orderNo.equals(that.orderNo) : that.orderNo != null) return false;
        if (orderType != null ? !orderType.equals(that.orderType) : that.orderType != null) return false;
        if (orderName != null ? !orderName.equals(that.orderName) : that.orderName != null) return false;
        if (pbChannel != null ? !pbChannel.equals(that.pbChannel) : that.pbChannel != null) return false;
        if (memberNo != null ? !memberNo.equals(that.memberNo) : that.memberNo != null) return false;
        if (invoiceType != null ? !invoiceType.equals(that.invoiceType) : that.invoiceType != null) return false;
        if (invoiceTitleType != null ? !invoiceTitleType.equals(that.invoiceTitleType) : that.invoiceTitleType != null)
            return false;
        if (invoiceTitle != null ? !invoiceTitle.equals(that.invoiceTitle) : that.invoiceTitle != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        if (taxpayerId != null ? !taxpayerId.equals(that.taxpayerId) : that.taxpayerId != null) return false;
        if (postType != null ? !postType.equals(that.postType) : that.postType != null) return false;
        if (earlyPrepare != null ? !earlyPrepare.equals(that.earlyPrepare) : that.earlyPrepare != null) return false;
        if (regAddress != null ? !regAddress.equals(that.regAddress) : that.regAddress != null) return false;
        if (receiverName != null ? !receiverName.equals(that.receiverName) : that.receiverName != null) return false;
        if (receiverMobile != null ? !receiverMobile.equals(that.receiverMobile) : that.receiverMobile != null)
            return false;
        if (receiverAddress != null ? !receiverAddress.equals(that.receiverAddress) : that.receiverAddress != null)
            return false;
        if (provider != null ? !provider.equals(that.provider) : that.provider != null) return false;
        if (payer != null ? !payer.equals(that.payer) : that.payer != null) return false;
        if (wantTime != null ? !wantTime.equals(that.wantTime) : that.wantTime != null) return false;
        if (companyTel != null ? !companyTel.equals(that.companyTel) : that.companyTel != null) return false;
        if (bankName != null ? !bankName.equals(that.bankName) : that.bankName != null) return false;
        if (bankAccount != null ? !bankAccount.equals(that.bankAccount) : that.bankAccount != null) return false;
        if (comment != null ? !comment.equals(that.comment) : that.comment != null) return false;
        if (displayText != null ? !displayText.equals(that.displayText) : that.displayText != null) return false;
        if (extensions != null ? !extensions.equals(that.extensions) : that.extensions != null) return false;
        return expressNo != null ? expressNo.equals(that.expressNo) : that.expressNo == null;

    }

    @Override
    public int hashCode() {
        int result = invoiceNo != null ? invoiceNo.hashCode() : 0;
        result = 31 * result + (terminalNo != null ? terminalNo.hashCode() : 0);
        result = 31 * result + (orderNo != null ? orderNo.hashCode() : 0);
        result = 31 * result + (orderType != null ? orderType.hashCode() : 0);
        result = 31 * result + (orderName != null ? orderName.hashCode() : 0);
        result = 31 * result + (pbChannel != null ? pbChannel.hashCode() : 0);
        result = 31 * result + (memberNo != null ? memberNo.hashCode() : 0);
        result = 31 * result + (invoiceType != null ? invoiceType.hashCode() : 0);
        result = 31 * result + (invoiceTitleType != null ? invoiceTitleType.hashCode() : 0);
        result = 31 * result + (invoiceTitle != null ? invoiceTitle.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (taxpayerId != null ? taxpayerId.hashCode() : 0);
        result = 31 * result + (postType != null ? postType.hashCode() : 0);
        result = 31 * result + (earlyPrepare != null ? earlyPrepare.hashCode() : 0);
        result = 31 * result + (regAddress != null ? regAddress.hashCode() : 0);
        result = 31 * result + (receiverName != null ? receiverName.hashCode() : 0);
        result = 31 * result + (receiverMobile != null ? receiverMobile.hashCode() : 0);
        result = 31 * result + (receiverAddress != null ? receiverAddress.hashCode() : 0);
        result = 31 * result + (provider != null ? provider.hashCode() : 0);
        result = 31 * result + (payer != null ? payer.hashCode() : 0);
        result = 31 * result + (wantTime != null ? wantTime.hashCode() : 0);
        result = 31 * result + (companyTel != null ? companyTel.hashCode() : 0);
        result = 31 * result + (bankName != null ? bankName.hashCode() : 0);
        result = 31 * result + (bankAccount != null ? bankAccount.hashCode() : 0);
        result = 31 * result + (comment != null ? comment.hashCode() : 0);
        result = 31 * result + (displayText != null ? displayText.hashCode() : 0);
        result = 31 * result + (extensions != null ? extensions.hashCode() : 0);
        result = 31 * result + (expressNo != null ? expressNo.hashCode() : 0);
        return result;
    }
}
